package com.xx.job.cloudgatewaygateway9527.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GatewayConfig {


    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder routeLocatorBuilder){
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();
        RouteLocator build = routes.route("payment8001", r -> r.path("/payment/selectById/**").uri("lb://SPRING-CLOUD-PAYMENT"))
               // .route("payment8002", r -> r.path("/payment/get/**").uri("http://127.0.0.1:8002"))
                .build();
        return build;
    }
}
